/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package estsapp.controladores.ConsultarCostosVariables;

import estsapp.DTOs.DTOCostoVariable;
import estsapp.utiles.modeloTabla.ModeloTabla;



/**
 *
 * @author Juan
 */
public class ModeloTablaCostosVariables extends ModeloTabla{
    
     public ModeloTablaCostosVariables() {
        super("Producto","Costo de materia prima","Costo de maquinarias","Costo de mano de obra","Costo variable total");
    }
    
    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (getListaElementos() == null) {
            return null;
        }
        DTOCostoVariable dto = (DTOCostoVariable) getListaElementos().get(rowIndex);
        
        switch (columnIndex) {
            case 0:
                return dto.getProducto().getNombre();
            case 1:
                return dto.getProducto().getCosto();
            case 2:
                return dto.getCostoHorasMaquina();
            case 3:
                return dto.getCostoManoDeObra();
            case 4:
                return dto.getProducto().getCosto()+dto.getCostoHorasMaquina()+dto.getCostoManoDeObra();
            default:
                return "";

        }
    }
}
